package com.newly.center.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.newly.common.base.entity.R;
import com.newly.common.base.entity.auth.ICurrentTenant;
import com.newly.common.base.entity.business.Dto.CompanyDto;
import com.newly.common.base.entity.business.Po.Company;
import com.newly.common.base.entity.business.Vo.DetailsVo;
import com.newly.common.core.utils.PageUtil;

import java.util.List;

/**
 * @anthor sbq
 * @date 2021/10/27 10:52
 */
public interface CompanyService extends IService<Company> {

    /**
     * 分页查询企业列表
     *
     * @param companyDto
     * @param currentTenant
     * @return
     */
    PageUtil getPage(ICurrentTenant currentTenant, CompanyDto companyDto);

    /**
     * 根据id查询企业基础信息和违法历史记录
     *
     * @param id
     * @return
     */
    DetailsVo<Company> getDetailsById(Long id, Integer offset);

    /**
     * 编辑
     *
     * @param company
     * @return
     */
    void edit(Company company);


    /**
     * 保存
     *
     * @param company
     * @param currentTenant
     * @return
     */
    void save(Company company, ICurrentTenant currentTenant);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    R delete(Long[] ids);

    /**
     * 获取所有公司名称
     *
     * @return
     */
    List<String> getCompanyNames();

    /**
     * 企业名称是否重复
     *
     * @param companyName
     * @return
     */
    boolean repeat(String companyName);

    /**
     * 通过id获取企业信息
     *
     * @param companyIds 企业id
     * @return List Company.class
     */
    List<Company> getByIds(List<String> companyIds);
}
